/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.user.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.pigx.user.dto.UserApiIpLockDTO;
import com.pig4cloud.pigx.user.entity.UserApiIp;
import com.pig4cloud.pigx.user.vo.UserApiIpCacheVO;
import com.pig4cloud.pigx.user.vo.UserApiIpVO;

import java.util.List;

/**
 * 用户apiKey ip
 *
 * @since 2022-10-28 15:47:40
 */
public interface UserApiIpService extends IService<UserApiIp> {

	/**
	 * 分页查询
	 *
	 * @param page      分页条件
	 * @param condition 查询条件
	 * @return {@link Page< UserApiIpVO>}
	 * @since 2022/10/28 17:41
	 */
	Page<UserApiIpVO> page(Page<UserApiIp> page, UserApiIp condition);

	/**
	 * 人工封禁
	 *
	 * @param dto dto
	 * @since 2022/10/31 11:43
	 */
	void lockManual(UserApiIpLockDTO dto);

	/**
	 * 人工解封
	 *
	 * @param dto dto
	 * @since 2022/10/31 13:58
	 */
	void unlockManual(UserApiIpLockDTO dto);

	/**
	 * 根据AccessKey查询相关IP信息
	 *
	 * @param apiKeyId  apiKeyId
	 * @param accessKey accessKey
	 * @return {@link List< UserApiIpCacheVO>}
	 * @since 2022/11/9 10:53
	 */
	List<UserApiIpCacheVO> getCache(Long apiKeyId, String accessKey);
}
